public class Goods {
    int gid;
    String gname;
    double price;

    public void outInfo(){
        System.out.println("商品信息:\n名称:"+gname+"\n编号:"+gid+"\n价格:￥"+price);
    }

    public static void main(String[] args) {
        Goods goods1 = new Goods();
        goods1.gname = "天体";
        goods1.gid = 237732697;
        goods1.price = 9.88;
        goods1.outInfo();
    }
}